//
//  kk_downBtn.m
//  kk_framework
//
//  Created by 7yao.top on 2018/11/5.
//  Copyright © 2018年 7yao.top. All rights reserved.
//

#import "kk_downBtn.h"

@implementation kk_downBtn

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat labelHeight = self.titleLabel.frame.size.height;
    CGFloat labelWidth = self.titleLabel.frame.size.width;
    CGFloat imageHeight = self.imageView.frame.size.height;
    
    
    CGRect titleRect = self.titleLabel.frame;
    titleRect.size.width = self.frame.size.width;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.frame = titleRect;
    self.imageEdgeInsets = UIEdgeInsetsMake(-labelHeight/2, labelWidth/2, labelHeight/2, -labelWidth/2);
    self.titleEdgeInsets = UIEdgeInsetsMake(imageHeight/2 + 15, 0, -imageHeight/2, 0);
    CGRect rect = self.titleLabel.frame;
    rect.origin.x = 0;
    self.titleLabel.frame = rect;
    
    
}
@end
